<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<style>
	.error-text{
		line-height: 20px;
		font-size:14px;
		color: rgb(209, 91, 71);
	}
</style>
<script type="text/dialog">
	var setting = {
		check:{enable:true,nocheckInherit:true},
		view:{selectedMulti:false},
		data:{simpleData:{enable:true}}
	}
	var zNodes =[
		<c:forEach items="${roleTree}" var="menu">
		{
			id:'${menu.id}', 
			pId:'${menu.pid}', 
			name:'${menu.name}'
		},
		</c:forEach>
	];
	var tree = $.fn.zTree.init($("#menuTree"), setting, zNodes);
	//判断哪些资源需要选中
	<c:forEach items="${Prole.permissionList}" var="mid">
		var node = tree.getNodeByParam("id", ${mid});
		try{
			tree.checkNode(node, true, false);
		}catch(e){}
	</c:forEach>
	tree.expandAll(true);
</script>
<div class="scheduleBox">
	<h3 class="lighter block green">查看当前角色资源</h3>
	<div class="col-sm-12">
		<div class="ztree" id="menuTree">
		</div>
	</div>
</div>